import request from '@/utils/request'

const BASE_URL = '/system/user'

export function getOne(id) {
  return request({
    url: `${BASE_URL}/${id}`,
    method: 'get'
  })
}

export function getList() {
  return request({
    url: BASE_URL,
    method: 'get'
  })
}

export function createOne(data) {
  return request({
    url: BASE_URL,
    method: 'post',
    data
  })
}

export function deleteById(id) {
  return request({
    url: `${BASE_URL}/${id}`,
    method: 'delete'
  })
}

export function deleteAll(data) {
  return request({
    url: BASE_URL,
    method: 'delete',
    data
  })
}

export function update(data) {
  return request({
    url: BASE_URL,
    method: 'put',
    data
  })
}

export function updatePassword(data) {
  return request({
    url: `${BASE_URL}/password`,
    method: 'put',
    data
  })
}
